<include file="public@header"/>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <div class="layui-page-header">
            <div class="layui-card">
                <div class="layui-page-header-content">
                    <div class="layui-card-body">
                        <div class="layui-ui-page-header-title" >
                            {:lang('USER_INDEXADMIN_INDEX')}<span class="layui-badge-rim page-content">网站首页注册用户管理</span>
                        </div>
                    </div>
                    <div class="layui-tab layui-tab-brief">
                        <ul class="layui-tab-title">
                            <li class="layui-this"><a href="{:url('user/index')}">{:lang('USER_INDEXADMIN_INDEX')}</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-page-content">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form class="layui-form" method="post" action="{:url('user/adminIndex/index')}">
                        <div class="layui-form-item layuiadmin-card-text" style="margin-bottom: 0;">
                            <div class="layui-inline">
                                <label class="layui-form-label">用户ID</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" name="uid" value="{:input('request.uid')}"
                                           placeholder="请输入用户ID">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">关键字</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" name="keyword" value="{:input('request.keyword')}"
                                           placeholder="用户名/昵称/邮箱/手机">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-inline">
                                    <input type="submit" class="layui-btn btn-primary" value="搜索"/>
                                    <a class="layui-btn layui-btn-danger btn-danger" href="{:url('user/adminIndex/index')}">清空</a>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="layui-page-content">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form method="post" class="js-ajax-form">
                        <table class="layui-table" lay-even lay-skin="nob" lay-size="lg">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>{:lang('USERNAME')}</th>
                                <th>{:lang('NICENAME')}</th>
                                <th>{:lang('AVATAR')}</th>
                                <th>{:lang('EMAIL')}</th>
                                <th>手机</th>
                                <th>{:lang('REGISTRATION_TIME')}</th>
                                <th>{:lang('LAST_LOGIN_TIME')}</th>
                                <th>{:lang('LAST_LOGIN_IP')}</th>
                                <th>{:lang('STATUS')}</th>
                                <th>{:lang('ACTIONS')}</th>
                            </tr>
                            </thead>
                            <tbody>
                            <php>
                                $user_statuses=array("0"=>lang('USER_STATUS_BLOCKED'),"1"=>lang('USER_STATUS_ACTIVATED'),"2"=>lang('USER_STATUS_UNVERIFIED'));
                            </php>
                            <foreach name="list" item="vo">
                                <tr>
                                    <td>{$vo.id}</td>
                                    <td>{$vo['user_login']?$vo['user_login']:($vo['mobile']?$vo['mobile']:lang('THIRD_PARTY_USER'))}
                                    </td>
                                    <td>{$vo['user_nickname']?$vo['user_nickname']:lang('NOT_FILLED')}</td>
                                    <td><img width="25" height="25" src="{:url('user/public/avatar',array('id'=>$vo['id']))}"/></td>
                                    <td>{$vo.user_email}</td>
                                    <td>{$vo.mobile}</td>
                                    <td>{:date('Y-m-d H:i:s',$vo['create_time'])}</td>
                                    <td>{:date('Y-m-d H:i:s',$vo['last_login_time'])}</td>
                                    <td>{$vo.last_login_ip}</td>
                                    <td>
                                        <switch name="vo.user_status">
                                            <case value="0">
                                                <span class="layui-badge-dot layui-bg-abnormal" style="margin-right: 6px;"></span>{$user_statuses[$vo['user_status']]}
                                            </case>
                                            <case value="1">
                                                <span class="layui-badge-dot layui-bg-function" style="margin-right: 6px;"></span>{$user_statuses[$vo['user_status']]}
                                            </case>
                                            <case value="2">
                                                <span class="layui-badge-dot layui-bg-default" style="margin-right: 6px;"></span>{$user_statuses[$vo['user_status']]}
                                            </case>
                                        </switch>
                                    </td>
                                    <td>
                                        <neq name="vo.id" value="1">
                                            <empty name="vo.user_status">
                                                <a class="layui-bo layui-bo-small layui-bo-succes js-ajax-dialog-btn"
                                                   href="{:url('adminIndex/cancelban',array('id'=>$vo['id']))}"
                                                   data-msg="{:lang('ACTIVATE_USER_CONFIRM_MESSAGE')}">{:lang('ACTIVATE_USER')}</a>
                                                <else/>
                                                <a class="layui-bo layui-bo-small layui-bo-waring js-ajax-dialog-btn"
                                                   href="{:url('adminIndex/ban',array('id'=>$vo['id']))}"
                                                   data-msg="{:lang('BLOCK_USER_CONFIRM_MESSAGE')}">{:lang('BLOCK_USER')}</a>
                                            </empty>
                                            <else/>
                                            <a class="layui-bo layui-bo-small layui-bo-primary layui-btn-disabled">{:lang('BLOCK_USER')}</a>
                                        </neq>
                                    </td>
                                </tr>
                            </foreach>
                            </tbody>
                        </table>
                        <div class="pagination">{$page}</div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<include file="public@script"/>
</body>
</html>